<?php
// +----------------------------------------------------------------------
// | QSCMS
// +----------------------------------------------------------------------
// | Copyright (c)  2025 https://www.qqss.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed QSCMS is not free software, commercial use must purchase official license from official website to avoid unnecessary legal disputes.
// +----------------------------------------------------------------------
// | Author: Contract 990504246@qq.com
// +----------------------------------------------------------------------

namespace app\api\controller;


class Agreement extends Base
{
    public function index()
    {
        $type = request()->post('type');
        match ($type) {
            'user_protocol' => $title = '用户协议',
            'pay_protocol' => $title = '付款协议',
            'privacy_protocol' => $title = '隐私协议',
            default => $this->error('协议不存在')
        };
        $data = [
            'title'   => $title,
            'content' => conf($type)
        ];
        $this->success('获取成功', $data);
    }

}